package com.controller;

import com.event.LoginEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * ClassName:UserLoginController
 * Package:com.controller
 *
 * @Date:2024/7/20 16:36
 * @Author:zxde
 */
@Component
@Slf4j
public class UserLoginController {

    @Autowired
    ApplicationEventPublisher applicationEventPublisher;

    public void login() {
        LoginEvent loginEvent = new LoginEvent(this,"1","2",new Date());
        applicationEventPublisher.publishEvent(loginEvent);
    }


}
